{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        {include file="public/tophead" /}
        {include file="public/top" /}
        <div class="ibox-content">
            <div class="row row-lg">
                <div class="fixed-table-toolbar">
                    <form method="get" action="">
                        <div class="pull-left search">
                            <div class="columns columns-right btn-group pull-left">
                                <select name="type" class="form-control">
                                    <option value="id">ID</option>
                                    <option value="content">内容</option>
                                </select>
                            </div>
                            <div class="pull-right search">
                                <button style="border-radius:0px; border:1px solid #e5e6e7; border-left:0px"
                                        class="btn btn-default btn-outline" type="submit">搜索
                                </button>
                            </div>
                            <div class="pull-right search">
                                <input class="form-control input-outline" type="text" name="text" placeholder="输入内容搜索" value="{:input('get.text', '')}" />
                            </div>
                        </div>
                    </form>
                </div>
                <div class="example">
                    <table data-toggle="table" data-striped="false">
                        <thead>
                        <tr>
                            <th data-align="center">ID</th>
                            <th data-align="center">内容</th>
                            <th data-align="center">置顶</th>
                            <th data-align="center">隐藏</th>
                            <th data-align="center">发布时间</th>
                            <th data-align="center">更新时间</th>
                            <th data-align="center">管理</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="data" id="vo"}
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.content}</td>
                            <td>{if $vo.is_top}是{else}否{/if}</td>
                            <td>{if $vo.is_hide}是{else}否{/if}</td>
                            <td>{$vo.create_time|date="Y-m-d H:i:s"}</td>
                            <td>{$vo.update_time|date="Y-m-d H:i:s"}</td>
                            <td>
                                <div class="btn-group">
                                    <button data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">操作 <span class="caret"></span></button>
                                    <ul class="dropdown-menu">
                                        <li><a onclick="add('{:url('proclamationAdd', ['id' => $vo['id']])}')">修改</a></li>
                                        <li class="divider"></li>
                                        <li><a onclick="changeTableVal('proclamation', 'id', {$vo.id}, 'is_top', {if $vo.is_top}0{else}1{/if}, '{if $vo.is_top}取消{/if}置顶')">{if $vo.is_top}取消{/if}置顶</a></li>
                                        <li><a onclick="changeTableVal('proclamation', 'id', {$vo.id}, 'is_hide', {if $vo.is_hide}0{else}1{/if}, '{if $vo.is_hide}取消{/if}隐藏')">{if $vo.is_hide}取消{/if}隐藏</a></li>
                                        <li class="divider"></li>
                                        <li><a onclick="del({$vo.id})">删除</a></li>
                                    </ul>
                                </div>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
            </div>
            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$page|raw}</div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.css"}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.js"}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table-zh-CN.min.js"}
<script type="text/javascript" src="__STYLE__/admin/js/common.js?ver=20200605"></script>
<script type="text/javascript">
function add(url){
    layer.open({
        type: 2,
        title: '公告管理',
        shadeClose: false,
        shade: 0.2,
        area: ['75%', '60%'],
        skin:'shangchuantup',
        // shift:-1,
        content: url,
    });
}
function del(id){
    swal_del(id,"{:url('proclamationDel')}", {title: '该公告'})
}
</script>